package utility;

import java.lang.reflect.Type;
import java.lang.reflect.ParameterizedType;
public class GetClass <T> {
	public static void main(String[] args) {
		Test<String> bean=new Test<String>();
		String string="hello";
		bean.update(string);
	}
	
	
}
	class Test<T>{
		public void update(T t) {  
	        Type type = getClass();  
	        Type trueType = ((ParameterizedType)type).getActualTypeArguments()[0];  
	        @SuppressWarnings("unchecked")
			Class<T> entityClass=(Class<T>) trueType;  
	        System.out.println(type);  
	        System.out.println(trueType);  
	        System.out.println(entityClass.getSimpleName());  
	    }  
	}
